<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>试题选择</title>
	<script type="text/javascript" charset="UTF-8" src="${pageContext.request.contextPath}/js/jquery-3.3.1.js"></script>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.css">
	<script type="text/javascript" charset="UTF-8" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
	<script type="text/javascript" charset="UTF-8" src="${pageContext.request.contextPath}/js/user/testPaperChoose.js"></script>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/user/other/jquery-labelauty.css">
	
</head>
<body>
	<jsp:include page="/WEB-INF/jsp/user/top.jsp"></jsp:include>
	<div style="height: 50px;"></div>
	<div class="row">
		<div class="col-md-12" style="background-color: #F4F4F4;height: 93%;background-image:url(${pageContext.request.contextPath}/img/laopo5.jpg);">
			<div style="height: 130px;"></div>
			<div class="col-md-3"></div>
			<div class="col-md-6" style="height: 400px;background-color: #FFFFFF;opacity:0.89;">
				<form id="form" class="form-horizontal" method="post">
					<div style="height: 50px;"></div>
					<div class="form-group">
						<label class="col-sm-2 control-label">中文释义</label>
						<div class="col-sm-4">
							<input autocomplete="off" disabled="disabled" value="${nowPageQuestion.word.wordChinese}" type="text" class="form-control">
					    </div>
					    <c:if test="${yourAnswer.wordChinese != null && yourAnswer.wordChinese != ''}">
					    	<label class="col-sm-2 control-label">你的答案</label>
						    <div class="col-sm-4">
								<input autocomplete="off" disabled="disabled" value="${yourAnswer.wordChinese}" type="text" class="form-control" id="wordChinese" >
						    </div>
					    </c:if>
					</div>
					<c:if test="${nowPageQuestion.word.wordPing != null && nowPageQuestion.word.wordPing != ''}">
						<div class="form-group">
							<label class="col-sm-2 control-label">平假名</label>
							<div class="col-sm-4">
								<input autocomplete="off" disabled="disabled" value="${nowPageQuestion.word.wordPing}" type="text" class="form-control nihonn">
						    </div>
						     <c:if test="${yourAnswer.wordPing != null && yourAnswer.wordPing != ''}">
						     	<label class="col-sm-2 control-label">你的答案</label>
							    <div class="col-sm-4">
									<input autocomplete="off" disabled="disabled" value="${yourAnswer.wordPing}" type="text" class="form-control">
							    </div>
						    </c:if>
						</div>
					</c:if>
					<c:if test="${nowPageQuestion.word.wordPian != null && nowPageQuestion.word.wordPian != ''}">
						<div class="form-group">
							<label class="col-sm-2 control-label">片假名</label>
							<div class="col-sm-4">
								<input autocomplete="off" disabled="disabled" value="${nowPageQuestion.word.wordPing}" type="text" class="form-control nihonn">
						    </div>
						    <c:if test="${yourAnswer.wordPian != null && yourAnswer.wordPian != ''}">
						    	<label class="col-sm-2 control-label">你的答案</label>
							    <div class="col-sm-4">
									<input autocomplete="off" disabled="disabled" value="${yourAnswer.wordPian}" type="text" class="form-control">
							    </div>
						    </c:if>
						</div>
					</c:if>
					<c:if test="${nowPageQuestion.word.wordWord != null && nowPageQuestion.word.wordWord != ''}">
						<div class="form-group">
							<label class="col-sm-2 control-label">单用汉字</label>
							<div class="col-sm-4">
								<input autocomplete="off" disabled="disabled" value="${nowPageQuestion.word.wordPing}" type="text" name="wordWord" class="form-control">
						    </div>
						    <c:if test="${yourAnswer.wordWord != null && yourAnswer.wordWord != ''}">
						    	<label class="col-sm-2 control-label">你的答案</label>
							    <div class="col-sm-4">
									<input autocomplete="off" disabled="disabled" value="${yourAnswer.wordWord}" type="text" class="form-control">
							    </div>
						    </c:if>
						</div>
					</c:if>
					<div class="form-group">
						<label class="col-sm-2 control-label">单词备注</label>
						<div class="col-sm-4">
							<textarea disabled="disabled" autocomplete="off" class="form-control" rows="3" name="wordContend">${nowPageQuestion.word.wordContend}</textarea>
					    </div>
					</div>
					<div class="form-group">
						<c:if test="${nowQuestionIndex > 1}">
							<div class="col-sm-offset-2 col-sm-3">
								<button id="submitButton" onclick="submit01()" type="submit" class="btn btn-info">上一题</button>
							</div>
						</c:if>
						<c:if test="${nowQuestionIndex < maxQuestionIndex}">
							<div class="col-sm-offset-2 col-sm-3">
								<button id="submitButton" onclick="submit02()" type="submit" class="btn btn-info">下一题</button>
							</div>
						</c:if>
						<c:if test="${nowQuestionIndex == maxQuestionIndex}">
							<div class="col-sm-offset-2 col-sm-3">
								<a href="${pageContext.request.contextPath}"><button id="submitButton" type="button" class="btn btn-warning">返回首页</button></a>
							</div>
						</c:if>
					</div>
				</form>
				<script>
					var pathName = window.document.location.pathname;
					var projectName = pathName.substring(0,pathName.substr(1).indexOf('/')+1);
					
					function submit01(){
						document.getElementById("form").action = projectName + "/Question/prevQuestion";
						document.getElementById("form").submit();
					}
					function submit02(){
						document.getElementById("form").action = projectName + "/Question/nextQuestion";
						document.getElementById("form").submit();
					}
				</script>
			</div>
			<div class="col-md-3"></div>
		</div>
	</div>
	
</body>
</html>